﻿
namespace FastMVVM.Core
{
    /// <summary>
    /// Represents a View that is assossiated through binding to a ViewModel.
    /// </summary>
    /// <typeparam name="TViewModel">The ViewModel's type that this View will be binding.</typeparam>
    public interface IView<TViewModel> where TViewModel : ViewModelBase
    {
        /// <summary>
        /// The ViewModel that this View will be binding to.
        /// </summary>
        TViewModel ViewModel { get; set; }

        /// <summary>
        /// Set the event handler to all the ViewModel's events.
        /// Need to be called from the constructor of your View
        /// (before "InitializeComponents", after instantiate the ViewModel property).
        /// </summary>
        void SetViewModelEventHandlers();
    }
}
